package com.netflexitysolutions.amazonws.ec2.internal.operations;

import com.amazonaws.ec2.doc._2009_04_04.RegisterImageType;
import com.netflexitysolutions.amazonws.ec2.EC2;

public class RegisterImageOperation extends OperationExecutor<RegisterImageType, String>{
	
	private String imageLocation;
	
	public RegisterImageOperation(EC2 ec2, String imageLocation) {
		super(ec2);
		this.imageLocation = imageLocation;
	}

	@Override
	protected String call(RegisterImageType request) {
		request.setImageLocation(imageLocation);
		return getEC2().getService().registerImage(request).getImageId();
	}

}
